package model.housedetail.controller;

import model.housedetail.entity.Detail;
import model.housedetail.service.IDetailService;
import model.newhouse.entity.Result;
import model.newhouse.entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DetailController {

    @Autowired
    private IDetailService detailService;

    @GetMapping("/find/{evaluateUsername}")
    public Result findDetail(@PathVariable("evaluateUsername") String evaluateUsername){
     Detail detail = detailService.findByName(evaluateUsername);

//        @Autowired
//        private Result result;
        Result result = new Result(true, StatusCode.OK,"成功",detail);
        return result;
    }
}
